Skip to content

feat(models): add StreamPETR with production three-stage training - #115

Closed
vividf wants to merge 8 commits into
tier4:mainfrom
vividf:feat/streampetr-production-configs
Closed

feat(models): add StreamPETR with production three-stage training#115
vividf wants to merge 8 commits into
tier4:mainfrom
vividf:feat/streampetr-production-configs

Conversation

@vividf

@vividf vividf commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds StreamPETR — a camera-only, temporally-modeled 3D object detector — end to end: the scene-streaming data pipeline its memory bank requires, the model (VoVNet backbone, CPFPN neck, query head with temporal memory, denoising queries, three-module ONNX export ABI), an auxiliary 2D FocalHead for training-time feature supervision, traffic_cone/barrier partial-ignore, DDP-correct loss normalization, and the production three-stage training configs (nuScenes pretrain → T4 base → j6gen2) pinned to the accepted runs.

Accepted results: stage 1 nuScenes val mAP 0.5031, stage 2 T4-base val mAP 0.4420, stage 3 j6gen2 test mAP 0.5025 (0–121 m bucket, comparable to AWML T4MetricV2 — see the evaluation-alignment notes in docs/models/streampetr.md).

How to review

Direct branch pushes to this repository are currently restricted (sec-inc-85 ruleset), so this lands as one PR instead of a stacked series. The history is already split into 8 self-contained commits, and the same 8 layers exist as a reviewable PR stack on the fork — each fork PR shows only its own layer's diff, with a detailed description, and was tested standalone:

# Layer (one commit each) Per-layer review
1 feat(datamodule): add scene-streaming dataloaders for temporal detectors vividf#7
2 feat(models): add StreamPETR building blocks vividf#8
3 feat(models): add the StreamPETR detector vividf#9
4 feat(streampetr): add base nuScenes and T4 j6gen2 configurations vividf#10
5 feat(streampetr): harden the streaming training infrastructure vividf#3
6 feat(streampetr): project 2D annotations and fold augmentations into ego poses vividf#4
7 feat(streampetr): add auxiliary 2D head, partial-ignore, and DDP loss normalization vividf#5
8 feat(streampetr): pin the production three-stage training configs vividf#6

Reviewing commit-by-commit on this PR gives the same per-layer diffs.

Testing

  • Every layer was tested standalone at its own commit; the full suite passes at the tip (606 passed; exclusions are pre-existing environment/main issues unrelated to this change).
  • Distributed correctness is covered by real multi-process gloo tests (loss sharding invariance, mixed-ground-truth deadlock regression).
  • Training efficacy is validated by the accepted three-stage runs above.

GroupStreamingSampler walks whole scenes frame by frame per dataloader lane,
the shared multiview datamodule wires it into every split, and
ResizeCropFlipRotImage folds resize/crop/flip into the camera intrinsics.

Signed-off-by: vividf <yihsiang.fang@tier4.jp>
VoVNet-99 multiscale backbone, grid-mask augmentation, the NMS-free 3D bbox
coder, box L1 match cost, and the temporal-query helper library (positional
embeddings, memory refresh, top-k gather, ego-frame point transforms).

Signed-off-by: vividf <yihsiang.fang@tier4.jp>
The query-based head with temporal memory (pre/post memory update, top-k
propagation, denoising queries, geometry-aware position embeddings) and the
model wrapper with the three-module ONNX export ABI.

Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Partial-annotation status plumbed through the multiview datasets, scene
contiguity validated at load time, shared-tensor-aware checkpoint loading,
epoch-end validation for variable-length streaming samplers, and the
iteration-warmup epoch-cosine LR schedule.

Signed-off-by: vividf <yihsiang.fang@tier4.jp>
…ego poses

LoadAnnotations2DFromBoxes3D projects the augmented 3D boxes onto every
camera for the auxiliary 2D head; the camera geometric augmentations fold
their transforms into the ego poses so the temporal memory warp stays
consistent; train-time camera-order shuffling follows the reference recipe.

Signed-off-by: vividf <yihsiang.fang@tier4.jp>
… normalization

Focal-PETR-style FocalHead2D supervising the image features during
training, CPFPN as the reference neck, traffic_cone/barrier partial-ignore
as classification-column weights shared by both heads, and cross-rank
positive-count normalization (mmdetection reduce_mean) with real
multi-process regression tests.

Signed-off-by: vividf <yihsiang.fang@tier4.jp>
Native three-stage flow (nuScenes pretrain -> T4 base -> j6gen2) with each
stage pinned to its accepted recipe, the 2.8.1 info generation (7 classes
with per-frame annotation status), a shared FocalHead2D config fragment,
and the reworked model documentation.

Signed-off-by: vividf <yihsiang.fang@tier4.jp>
@vividf
vividf requested a review from amadeuszsz as a code owner September 3, 2026 16:47
@vividf
vividf marked this pull request as draft September 3, 2026 17:00
@vividf

vividf commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded: landing this incrementally instead — one layer per PR, starting with the scene-streaming data pipeline. Each next layer will be opened against main once the previous one merges, so every PR stays a small, self-contained diff. The full stack is reviewable per-layer on the fork (vividf#7#10, #3#6).

@vividf vividf closed this Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant